<!doctype html>
<html class="default no-js">
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>BasePoly | ts</title>
	<meta name="description" content="Documentation for ts">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="stylesheet" href="../assets/css/main.css">
</head>
<body>
<header>
	<div class="tsd-page-toolbar">
		<div class="container">
			<div class="table-wrap">
				<div class="table-cell" id="tsd-search" data-index="../assets/js/search.json" data-base="..">
					<div class="field">
						<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
						<input id="tsd-search-field" type="text" />
					</div>
					<ul class="results">
						<li class="state loading">Preparing search index...</li>
						<li class="state failure">The search index is not available</li>
					</ul>
					<a href="../index.html" class="title">ts</a>
				</div>
				<div class="table-cell" id="tsd-widgets">
					<div id="tsd-filter">
						<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
						<div class="tsd-filter-group">
							<div class="tsd-select" id="tsd-filter-visibility">
								<span class="tsd-select-label">All</span>
								<ul class="tsd-select-list">
									<li data-value="public">Public</li>
									<li data-value="protected">Public/Protected</li>
									<li data-value="private" class="selected">All</li>
								</ul>
							</div>
							<input type="checkbox" id="tsd-filter-inherited" checked />
							<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
							<input type="checkbox" id="tsd-filter-externals" checked />
							<label class="tsd-widget" for="tsd-filter-externals">Externals</label>
							<input type="checkbox" id="tsd-filter-only-exported" />
							<label class="tsd-widget" for="tsd-filter-only-exported">Only exported</label>
						</div>
					</div>
					<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
				</div>
			</div>
		</div>
	</div>
	<div class="tsd-page-title">
		<div class="container">
			<ul class="tsd-breadcrumb">
				<li>
					<a href="../globals.html">Globals</a>
				</li>
				<li>
					<a href="../modules/_laya_webgl_shapes_basepoly_.html">&quot;laya/webgl/shapes/BasePoly&quot;</a>
				</li>
				<li>
					<a href="_laya_webgl_shapes_basepoly_.basepoly.html">BasePoly</a>
				</li>
			</ul>
			<h1>Class BasePoly</h1>
		</div>
	</div>
</header>
<div class="container container-main">
	<div class="row">
		<div class="col-8 col-content">
			<section class="tsd-panel tsd-hierarchy">
				<h3>Hierarchy</h3>
				<ul class="tsd-hierarchy">
					<li>
						<span class="target">BasePoly</span>
					</li>
				</ul>
			</section>
			<section class="tsd-panel-group tsd-index-group">
				<h2>Index</h2>
				<section class="tsd-panel tsd-index-panel">
					<div class="tsd-index-content">
						<section class="tsd-index-section ">
							<h3>Methods</h3>
							<ul class="tsd-index-list">
								<li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><a href="_laya_webgl_shapes_basepoly_.basepoly.html#createline2" class="tsd-kind-icon">create<wbr>Line2</a></li>
								<li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><a href="_laya_webgl_shapes_basepoly_.basepoly.html#createlinetriangle" class="tsd-kind-icon">create<wbr>Line<wbr>Triangle</a></li>
							</ul>
						</section>
					</div>
				</section>
			</section>
			<section class="tsd-panel-group tsd-member-group ">
				<h2>Methods</h2>
				<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-static">
					<a name="createline2" class="tsd-anchor"></a>
					<h3><span class="tsd-flag ts-flagStatic">Static</span> create<wbr>Line2</h3>
					<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-static">
						<li class="tsd-signature tsd-kind-icon">create<wbr>Line2<span class="tsd-signature-symbol">(</span>p<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span>, indices<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span>, lineWidth<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, indexBase<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, outVertex<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span>, loop<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></li>
					</ul>
					<ul class="tsd-descriptions">
						<li class="tsd-description">
							<aside class="tsd-sources">
								<ul>
									<li>Defined in <a href="https://github.com/layabox/LayaAir/blob/1e27d6b9/src/layaAir/laya/webgl/shapes/BasePoly.ts#L14">laya/webgl/shapes/BasePoly.ts:14</a></li>
								</ul>
							</aside>
							<div class="tsd-comment tsd-typography">
								<div class="lead">
									<p>构造线的三角形数据。根据一个位置数组生成vb和ib</p>
								</div>
							</div>
							<h4 class="tsd-parameters-title">Parameters</h4>
							<ul class="tsd-parameters">
								<li>
									<h5>p: <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></h5>
								</li>
								<li>
									<h5>indices: <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></h5>
								</li>
								<li>
									<h5>lineWidth: <span class="tsd-signature-type">number</span></h5>
								</li>
								<li>
									<h5>indexBase: <span class="tsd-signature-type">number</span></h5>
									<div class="tsd-comment tsd-typography">
										<p>顶点开始的值，ib中的索引会加上这个</p>
									</div>
								</li>
								<li>
									<h5>outVertex: <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></h5>
								</li>
								<li>
									<h5>loop: <span class="tsd-signature-type">boolean</span></h5>
								</li>
							</ul>
							<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></h4>
						</li>
					</ul>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-static">
					<a name="createlinetriangle" class="tsd-anchor"></a>
					<h3><span class="tsd-flag ts-flagStatic">Static</span> create<wbr>Line<wbr>Triangle</h3>
					<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-static">
						<li class="tsd-signature tsd-kind-icon">create<wbr>Line<wbr>Triangle<span class="tsd-signature-symbol">(</span>path<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span>, color<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, width<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, loop<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span>, outvb<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Float32Array</span>, vbstride<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, outib<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Uint16Array</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
					</ul>
					<ul class="tsd-descriptions">
						<li class="tsd-description">
							<aside class="tsd-sources">
								<ul>
									<li>Defined in <a href="https://github.com/layabox/LayaAir/blob/1e27d6b9/src/layaAir/laya/webgl/shapes/BasePoly.ts#L146">laya/webgl/shapes/BasePoly.ts:146</a></li>
								</ul>
							</aside>
							<div class="tsd-comment tsd-typography">
								<div class="lead">
									<p>相邻的两段线，边界会相交，这些交点可以作为三角形的顶点。有两种可选，一种是采用左左,右右交点，一种是采用 左右，左右交点。当两段线夹角很小的时候，如果采用
										左左，右右会产生很长很长的交点，这时候就要采用左右左右交点，相当于把尖角截断。
										当采用左左右右交点的时候，直接用切线的垂线。采用左右左右的时候，用切线
										切线直接采用两个方向的平均值。不能用3-1的方式，那样垂线和下一段可能都在同一方向（例如都在右方）
									注意把重合的点去掉</p>
								</div>
							</div>
							<h4 class="tsd-parameters-title">Parameters</h4>
							<ul class="tsd-parameters">
								<li>
									<h5>path: <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></h5>
								</li>
								<li>
									<h5>color: <span class="tsd-signature-type">number</span></h5>
								</li>
								<li>
									<h5>width: <span class="tsd-signature-type">number</span></h5>
								</li>
								<li>
									<h5>loop: <span class="tsd-signature-type">boolean</span></h5>
								</li>
								<li>
									<h5>outvb: <span class="tsd-signature-type">Float32Array</span></h5>
								</li>
								<li>
									<h5>vbstride: <span class="tsd-signature-type">number</span></h5>
									<div class="tsd-comment tsd-typography">
										<p>顶点占用几个float,(bytelength/4)</p>
									</div>
								</li>
								<li>
									<h5>outib: <span class="tsd-signature-type">Uint16Array</span></h5>
									<div class="tsd-comment tsd-typography">
										<p>test:
											横线
											[100,100, 400,100]
											竖线
											[100,100, 100,400]
											直角
											[100,100, 400,100, 400,400]
											重合点
											[100,100,100,100,400,100]
											同一直线上的点
											[100,100,100,200,100,3000]
											像老式电视的左边不封闭的图形
										[98,176,  163,178, 95,66, 175,177, 198,178, 252,56, 209,178,  248,175,  248,266,  209,266, 227,277, 203,280, 188,271,  150,271, 140,283, 122,283, 131,268, 99,268]</p>
									</div>
								</li>
							</ul>
							<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
						</li>
					</ul>
				</section>
			</section>
		</div>
		<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
			<nav class="tsd-navigation primary">
				<ul>
					<li class="globals  ">
						<a href="../globals.html"><em>Globals</em></a>
					</li>
					<li class="current tsd-kind-module">
						<a href="../modules/_laya_webgl_shapes_basepoly_.html">&quot;laya/webgl/shapes/<wbr>Base<wbr>Poly&quot;</a>
					</li>
				</ul>
			</nav>
			<nav class="tsd-navigation secondary menu-sticky">
				<ul class="before-current">
				</ul>
				<ul class="current">
					<li class="current tsd-kind-class tsd-parent-kind-module">
						<a href="_laya_webgl_shapes_basepoly_.basepoly.html" class="tsd-kind-icon">Base<wbr>Poly</a>
						<ul>
							<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-static">
								<a href="_laya_webgl_shapes_basepoly_.basepoly.html#createline2" class="tsd-kind-icon">create<wbr>Line2</a>
							</li>
							<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-static">
								<a href="_laya_webgl_shapes_basepoly_.basepoly.html#createlinetriangle" class="tsd-kind-icon">create<wbr>Line<wbr>Triangle</a>
							</li>
						</ul>
					</li>
				</ul>
				<ul class="after-current">
				</ul>
			</nav>
		</div>
	</div>
</div>
<footer>
	<div class="container">
		<h2>Legend</h2>
		<div class="tsd-legend-group">
			<ul class="tsd-legend">
				<li class="tsd-kind-variable"><span class="tsd-kind-icon">Variable</span></li>
				<li class="tsd-kind-function"><span class="tsd-kind-icon">Function</span></li>
			</ul>
			<ul class="tsd-legend">
				<li class="tsd-kind-class"><span class="tsd-kind-icon">Class</span></li>
				<li class="tsd-kind-class tsd-has-type-parameter"><span class="tsd-kind-icon">Class with type parameter</span></li>
			</ul>
			<ul class="tsd-legend">
				<li class="tsd-kind-enum"><span class="tsd-kind-icon">Enumeration</span></li>
			</ul>
			<ul class="tsd-legend">
				<li class="tsd-kind-interface"><span class="tsd-kind-icon">Interface</span></li>
			</ul>
			<ul class="tsd-legend">
				<li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static method</span></li>
			</ul>
		</div>
	</div>
</footer>
<div class="overlay"></div>
<script src="../assets/js/main.js"></script>
</body>
</html>